#include "TcpServer.hpp"
#include "ServerCal.hpp"

void Usage(std::string proc)
{
    std::cout << "\n\rUsage: " << proc << " port[1024+]" << std::endl;
}

int main(int argc, char *argv[])
{
    if(argc != 2)
    {
        Usage(argv[0]);
        exit(1);
    }
    uint16_t port = std::stoi(argv[1]);

    ServerCal cal;
    TcpServer* tsvr = new TcpServer(port, std::bind(&ServerCal::Caculator, &cal, std::placeholders::_1));
    tsvr->InitServer();
    tsvr->Start();
    return 0;
}